SUPER-WUMPUS By Jack Emmerichs Published 1978 ISBN: 0-931718-0301 Description from Back of Book ----------------------------- SUPER-WUMPUS, by Jack Emmerichs, is an exciting computer game incorporating the original structure of the WUMPUS game described in the book "What To Do After You Hit Return," published by the People's ComputerCompany, along with added features which make the game even more fascinating. Programmed in both 6800 assembly language and BASIC, the game is not only addictively fun, but also provides a splendid tutorial on setting up unusual data structures (the tunnel and cave system of SUPERWUMPUS form a dodecahedron). Table of Contents ----------------- The Origin The Game Fundamentals Extensions Supplies Random Events One Last Chance Rules Program Notes The 6800 Assembler Program The BASIC Program Appendices A. Sample Run of BASIC SUPERWUMPUS B. Source Listings 6800 Assembler Source Listing BASIC Source Listing C. Bar Codes 6800 Assembler Bar Code BASIC Bar Code The Origin The game of SUPERWUMPUS is based on the game of :WUMPUS, as described in the book What To Do After You Hit Return by the People's Computer Company. Since the source listing for WUMPUS was not printed in the original PCC book, SUPERWUMPUS has been written from scratch, in both 6800 assembler code and BASIC. The primary differences between the two versions are program size and machine dependency. The 6800 assembler program will run in 4 K of user programmable memory with room to spare, but cannot be directly used with any other type of processor. With varying degrees of program modification, the BASIC program can be made to run on virtually any machine supported by a BASIC interpreter, and will require about 9,950 bytes of work space in addition to the memory required by the interpreter. Although both listings can be used as they are, the 6800 assembler program listing warrants further explanation. The assembler that created this listing is the same program that was used to write "6800 Tiny Assembler (available as a PAPERBYTE book, Tiny Assembler 6800 Version 3.1, or see the April and May 1977 issues of BYTE magazine). "Tiny Assembler 6800" is a one pass rather than the normal two pass assembler, and the listing differs significantly. The generated code for the operand of a forward reference is a dummy value of zero. This is not executable code even though it is printed on the source listing. The actual executable code is developed when the forward reference is resolved by using the referenced symbol as a label. The actual operand is then printed on the listing directly under the statement containing that label. Note that when this happens, the address given for this code will cause it to overlay the earlier dummy code (this may take a bit of getting used to at first, so be sure you know how it works before you attempt to make any modifications based on this listing). Notes on special notation and other items of interest to anyone translating the BASIC listing will be found on page 11 in the section called "The BASIC Program." The Game Fundamentals The game begins with the player (hunter) somewhere deep within the Wumpus's cave, which consists of 20 rooms connected by tunnels. The rooms form the vertices of a dodecahedron and the tunnels form its edges. Therefore, each room has three tunnels connecting it to other rooms. The player starts in one of these rooms while the Wumpus is asleep in another. The hunter begins with five arrows or darts with which to shoot the Wumpus. Each arrow may be used only once. In the 6800 assembler version of the game, the object is to kill the Wumpus before he (she? it?) can find and eat the hunter. After watching several people become the blood-thirsty killers of an animal that they knew nothing about, and being of much more humane sentiments, I decided to change the object of the BASIC version of the game to that of immobilizing the beast so that it can be tagged with a beeper. When the beast wakes up, it will lead the hunter out of the caves and that is the only way the exit can be found. The play of the game is the same for both SUPERWUMPUS versions but there is less violence in the BASIC version. To complicate things a bit, there are bottomless pits In some of the rooms. If you move into one of these, you fall out of sight, and emit a pitiful scream. This causes the premature termination of the game. There are also rooms full of bats in the cave in which the bats pick you up, fly you around for awhile, and then drop you randomly into a new room. Note: bats can drop you into a pit, into another room of bats, or on top of the Wumpus! In the original WUMPUS there were a fixed number of bat caves and pits, but in SUPERWUMPUS the number as well as the location of these hazards changes for each new game. For each turn, the player is told the number of the room the hunter is currently in, the numbers of the rooms connected to it by tunnels, and the presence of any hazards (pits, bats or the Wumpus) that are exactly one room away. Alas, the player is not told which room such a hazard is in. During each turn the hunter may move into an adjoining room or shoot through several connecting rooms. The hunter must move carefully through the caves avoiding hazards until the sleeping Wumpus is found ? and then shoot him. While trying to navigate the caves, it is a good idea to make a map showing the locations of everything found so far. If the search for the Wumpus is a long one, alternate routes and shortcuts begin to appear, and hazards can often be pinned down to specific rooms. If the hunter makes a shot but does not hit the Wumpus, the Wumpus will wake up and become a much harder to find moving target. The Wumpus may also be awakened if a clumsy hunter stumbles into his room and steps on him. (Getting out of this situation is dangerous, but it can be done.) If the awakened Wumpus comes into your room, or if you blunder into his, he will eat you up; end of game. To add a margin of safety to the game, the hunter may back up and shoot through from one to five rooms, as long as they are connected. If they are not connected, the shot goes wild and may hit just about anything, including the hunter! In the 6800 assembler version of the game, the number of rooms that may be shot through has been reduced from five to three to eliminate some tricky strategies that could make the game trivial. In the BASIC version this has been accomplished by not allowing the hunter to shoot through the same room more than once per turn. Extensions The preceding was about all that was printed about the game of WUMPUS in the first edition of What To Do After You Hit Return, and is certainly enough to spark one's interest. Since SUPERWUMPUS was to be written from scratch, it seemed like an ideal opportunity to incorporate more and better goodies. In searching for such goodies, several people spent an amazing amount of time tossing around some truly strange ideas, many of which were based on aspects of other well known computer games that had proven to be quite enjoyable. Supplies The first change in the game provides a finite amount of some necessary resource which can be diminished as time is used up. Without such a restriction, a careful player could often poke about the caves for as long as it takes to locate the Wumpus and all hazards. Among the several time limits considered to prevent such slow games: available oxygen in the caves, diminishing flashlight batteries, food, water, and an arbitrary number of hours or days. It was finally decided that a quantity of nonspecific "supplies" should be used because fewer problems would be encountered in trying to integrate the new components into the game's structure. This general resource also allows the game to increment or decrement the available supplies randomly throughout the game. If the supplies run out before the Wumpus has been caught, the hunter starves to death and loses. The amount of supplies used in both the 6800 assembler and BASIC versions of the game has been set after many experiments, but like most values in the game, can be changed by the user if desired. Random Events The second major change in the game was to introduce a series of random events beyond the player's control that can change the course of the game. Random events are fairly common in computer games and usually provide the game with a personality all its own. In SUPERWUMPUS several variables can be randomly changed by the user: the amount of supplies available, the configuration of the caves, the player's location, the location of the Wumpus and hazards, the number of shots left, and on and on. It is important, however, to keep the game from getting out of control or from becoming either too simple or too difficult. For example, a random good event should be balanced against a bad one. The first event that has been introduced is to allow rats to come up from the pits and devour half of the hunter's available supplies. Having a limited quantity of supplies is in itself a restriction, and losing half of them could be devastating. To compensate for this, the second event has been added: the hunter now finds supplies left over from a previous (eaten?) hunter. To keep these events from cancelling one another, the supplies found are always a small, random amount. This is a minor compensation for losing half of your existing supplies, so the probability of finding supplies is higher than that of the rats devouring them. The final effect is that rats attacking at the beginning of the game (when there are more' supplies to lose) can be disastrous; rats attacking at the end of the game are not so bad; and finding supplies is a minor boon whenever it happens. (An increase in supplies may happen frequently and can often save the hunter near the end of a tight game.) Another random event outdates the player's map. A rockslide from deep within the caves can close a tunnel. Tunnels closed in that manner are never reopened during a game, and the player is only informed that a rockslide happened, not where it occurred. This simulates the echoing reverberation of a real rockslide, were one in a real cave. No player, Wumpus, or arrow may go through a closed tunnel, but bats (who know secret passageways between rooms) are not affected by such closures. Rockslides are fairly uncommon and are only a minor nuisance. (You might want to experiment with a shaky cave having a high propensity for slides to see how it changes the game.) The last random event can have a major effect on the game. A colony of bats may migrate from one room to another. Again the player is informed that the event has occurred, but not where. For example, if a map has two bat colonies marked on it when a migration occurs, one of these notations may become incorrect. At the same time, rooms previously known to be safe may become the new home of the migrating colony. An additional inconvenience is that, when the bats move, the hunter is forced to hide and use up some supplies waiting for things to quiet down. To confuse things further, the bats may move right into the hunter's room. If they do, the hunter will be relocated as if the hunter had stumbled into a bat colony's cave. To add injury to insult, the hunter cannot hang on to all of his supplies while hanging from a bat, so some supplies are lost each time the bats relocate the hunter. All of this can get somewhat discouraging if you are finally dropped into another colony of bats, and so on. Several other random events were considered but not implemented because they took up too much room in code, made the game too easy, hard, or different, or because they simply did not 'feel' right. Unused random events included: * Finding arrows which could be reused. * Moving the Wumpus more than one room at a time. * Creating new pits or bat colonies. * Finding footprints revealing where the Wumpus has been. * Having the hunter break a leg or sustain some other physical injury which would slow down movement within the cave. One Last Chance The third major change to the original game was developed to benefit the hunter who has used up all five arrows or darts. As the game was originally set up, a player could only wait until the Wumpus found the hunter, or until his supplies had run out and the game was lost. This seemed unsatisfying, and a way was sought which would give the hunter one last chance of winning, however small. Several approaches were considered: hand to hand combat with a small chance of winning; hand to hand combat with the last arrow as a hand weapon providing better odds for the hunter; a small chance of being able to wear the Wumpus down psychologically in an argument (not considered for long); hiding a knife in the cave, letting the hunter search for it, and going back to hand to hand combat; and many more. The final choice gives the hunter an opportunity to find some loose rocks after the last arrow is spent, and then hurl them at the Wumpus at close range, in hopes of knocking him out. To implement this, finding a rock to throw has been added as another random event that happens after all the arrows are gone. A rock can be thrown into only one room (using the shoot command). If that room contains the Wumpus, the rock may or may not hit him, and if it does hit him it may or may not knock him out. The chances of having all of this work out are so slim that I have never seen a game won by throwing rocks, but it is possible. (Usually the supplies will have been exhausted before the hunter can get into a room next to the Wumpus, who is moving about by then, and throw a rock.) Rules Several aspects of the game have been left undefined in the WUMPUS writeup mentioned above. Generally, the approach taken in SUPERWUMPUS has been to choose rules that introduce random action where possible, without making the program unduly complex. Standard message formats have been designed to limit the amount of additional information that can be deduced from them. The rules that have been selected are as follows: * You may shoot through a bat cave, but you may hit a bat. You will be told if you hit a bat, but not the number of the room that the bats are in. * You may shoot over a pit, but you may lose your arrow. Again, you are told that you lost your arrow, but not the number of the room in which it was lost. * A room may not contain more than one hazard (bats, pits or the Wumpus). * You may be dropped ANYWHERE by the bats. * The awakened Wumpus may or may not move during each turn. * When the Wumpus moves, it is always to an empty room that is connected to his current room. If he is surrounded by hazards and closed tunnels, he is boxed in and unable to move. * If you shoot yourself (some hunter!), you may or may not die from the shot. Injuries are severe, however, and require consumption of some of the hunter's limited supplies. * Between games, all room numbers are scrambled, so an old map is no good in a new game. Furthermore, there is no correlation between the order in which connecting rooms are printed for each turn, and the listing order of warning messages for nearby hazards.